//
//  MyDetailTableViewCell.swift
//  股票框架
//
//  Created by 李小骥 on 2017/10/19.
//  Copyright © 2017年 李小骥. All rights reserved.
//

import UIKit

class MyDetailTableViewCell: UITableViewCell {
    var rightLabel:UILabel!
    var hiddenHeadImage:Bool{
        willSet{
            headImageView.isHidden = newValue
            headImageView.isUserInteractionEnabled = !newValue
            rightLabel.isHidden = !newValue
        }
    }
    var headImageView:UIImageView{
        let radius = 40
            let img = UIImageView(frame: CGRect(center: CGPoint(x: SCREEN_WIDTH-30, y: (size.height)-20), size: CGSize(width: radius, height: radius)))
            img.layer.cornerRadius = img.size.height/2
            img.layer.masksToBounds = true
            if(currentHeadImage != nil){
                img.image = currentHeadImage!
            }else{
                img.image = UIImage(named: "unloginHead")
            }
            return img
        }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        hiddenHeadImage = true
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        rightLabel = UILabel(frame: CGRect(center: CGPoint(x: SCREEN_WIDTH-100, y: size.height/2), size: CGSize(width: 180, height: size.height)))
        rightLabel.textAlignment = .right
//        codeLabel = UILabel(frame: CGRect(x: 20, y: 10, width: 50, height: 30))
        
//        nameLabel = UILabel(frame: CGRect(x: 90, y: 10, width: 50, height: 30))
//        pinyinLabel = UILabel(frame: CGRect(x: 160, y: 10, width: 50, height: 30))
//        rightButton = CustomButton(frame: CGRect(x: 230, y: 10, width: 50, height: 30))
//        contentView.addSubview(codeLabel)
//        contentView.addSubview(nameLabel)
//        contentView.addSubview(pinyinLabel)
//        contentView.addSubview(rightButton)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
